{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block head_script %}
    <script src="{{ url_for('static', filename='chartkick/Chart.bundle.min.js') }}"></script>
    <script src="{{ url_for('static', filename='chartkick/chartkick.js') }}"></script>
{% endblock %}


{% block page_content %}
<div class="post-preview">


    <div class="panel panel-default">
        <div class="panel-heading">
            <i class="fa fa-pie-chart" aria-hidden="true"></i>
            第{{ week_count }}周 ({{start_at}}至{{end_at}}) {{current_user.department.name}} 周报统计
            {% if get_this_week_count() == week_count %}
                <a href="{{url_for('report.statistics_department_last_week')}}">
                    (查看上周)
                </a>
            {% endif %}
        </div>
        <div class="panel-body">
        {% pie_chart data %}
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading">
            <i class="fa fa-users" aria-hidden="true"></i>
            {{ current_user.department.name }}
        </div>

        <div class="panel-body">

            <a>已交:</a>
                {% for name in names['has_submitted'] %}
                    <a rel="tag" class="post-tag">{{ name }}</a>
                {% endfor %}
            <hr style="height:2pt; visibility:hidden;" />
            <a>未交:</a>
                {% for name in names['not_yet'] %}
                    <a rel="tag" class="post-red-tag">{{ name }}</a>
                {% endfor %}
        </div>
    </div>
</div>
{% endblock %}
